<template>
	<view style="padding-bottom: 200rpx;" :style="objColor">
		<!-- <image class="header-image" src="https://oos-cn.ctyunapi.cn/front-end/static/cartoon/orderBg.png"></image> -->
		<!-- <customer></customer> -->
		<image class="header-image" :src="(mixOtherIconList[5] && mixOtherIconList[5].icon)"/>
		<customNavigationBar/>
		<view>
			<!-- 头部 star -->
			<view class="header" :style="headerStyle">
				<!-- 登录 根据身份判断显示页面 -->
				<view class="login">
					<!-- 未登录 A -->
					<view v-if="!isLogin">
						<view class="login-default" style="height: 153rpx">
							<view class="header" @tap="loginTost">
								<image class="header-image default-image"
									src="https://oos-cn.ctyunapi.cn/front-end/static/static/header.png"/>
							</view>
							<view class="header-div" style="margin-left:30rpx" @tap="login">
								<view class="header-login">注册/登录</view>
								<view class="header-text">同步订单信息，发现更多精彩</view>
							</view>
						</view>
						<!-- 账户信息 -->
						<view class="account">
							<view class="account-in" @tap="loginTost">
								<view class="account-number">0.00</view>
								<p>账户余额(元)</p>
							</view>
							<view class="account-in" @tap="naviCardYxhk">
								<view class="account-number">0</view>
								<p>卡券</p>
							</view>
							<view class="account-in" @tap="naviIntegral">
								<view class="account-number">0</view>
								<p>积分</p>
							</view>
						</view>
						<!-- 未登录的会员!!! -->
						<!-- 付费会员暂时隐藏 -->
						<view v-if="(!menberData&&noVipData.length!=0)" class="noVip">
							<view>
								<swiper :autoplay="true" circular class="swiperBox" :duration="duration"
									:indicator-dots="indicatorDots">
									<swiper-item v-for="(item,index) in noVipData" :key="index" class="swipersItem"
										:style="{ backgroundImage: `url(${imgUrlBase1}/group1/image/asf3216732176332384044052.png)` }"
										@click="toBuyVip(item)">
										<view class="jiesheng">
											<view>{{ item.vipName }}</view>
										</view>
										<view v-if='item.monthlyEnabled===1 && item.monthlyDiscountEnabled===1' class="lisheng">
											<view v-if="item.monthlyDiscountEnabled == 1" class="tehui">包月首开特惠</view>
											{{item.monthlyDiscountEnabled == 1?'立省':'包月'}}
											￥{{ (item.monthlyPrice-item.monthlyDiscountPrice) | toFixedF  }}
										</view>
										<view v-else-if='item.quarterlyEnabled===1&&item.quarterlyDiscountEnabled===1' class="lisheng">
											<view v-if="item.quarterlyDiscountEnabled == 1" class="tehui">包季首开特惠</view>
											{{item.quarterlyDiscountEnabled == 1?'立省':'包季'}}
											￥{{ (item.quarterlyPrice-item.quarterlyDiscountPrice) | toFixedF  }}
										</view>
										<view v-else-if='item.halfEnabled===1&&item.halfDiscountEnabled===1' class="lisheng">
											<view v-if="item.halfDiscountEnabled == 1" class="tehui">包半年首开特惠</view>
											{{item.halfDiscountEnabled == 1?'立省':'包半年'}}
											￥{{ (item.halfPrice - item.halfDiscountPrice) | toFixedF  }}
										</view>
										<view v-else-if='item.yearlyEnabled==1&&item.yearlyDiscountEnabled==1' class="lisheng">
											<view v-if="item.yearlyDiscountEnabled == 1" class="tehui">包年首开特惠</view>
											{{item.yearlyDiscountEnabled == 1?'立省':'包年'}}
											￥{{ (item.yearlyPrice - item.yearlyDiscountPrice) | toFixedF  }}
										</view>
										<view v-else-if='item.monthlyEnabled===1' class="lisheng">
											<view v-if="item.monthlyDiscountEnabled == 1" class="tehui">包月首开特惠</view>
											{{item.monthlyDiscountEnabled == 1?'立省':'包月'}}
											￥{{ (item.monthlyPrice) | toFixedF  }}
										</view>
										<view v-else-if='item.quarterlyEnabled===1' class="lisheng">
											<view v-if="item.quarterlyContinuousEnabled == 1" class="tehui">包季首开特惠</view>
											{{item.quarterlyContinuousEnabled == 1?'立省':'包季'}}
											￥{{ (item.monthlyPrice) | toFixedF  }}
										</view>
										<view v-else-if='item.halfEnabled===1' class="lisheng">
											<view v-if="item.halfContinuousEnabled == 1" class="tehui">包半年首开特惠</view>
											{{item.halfContinuousEnabled == 1?'立省':'包半年'}}
											￥{{ (item.monthlyPrice) | toFixedF  }}
										</view>
										<view v-else-if='item.yearlyEnabled==1' class="lisheng">
											<view v-if="item.yearlyContinuousEnabled == 1" class="tehui">包年首开特惠</view>
											{{item.yearlyContinuousEnabled == 1?'立省':'包年'}}
											￥{{ (item.monthlyPrice) | toFixedF  }}
										</view>
									</swiper-item>
								</swiper>
							</view>
							<!-- <view>
								<swiper class="swiperBox" circular :indicator-dots="indicatorDots" :autoplay="true"
									:duration="duration">
									<swiper-item class="swipersItem" @click="toBuyVip(item)" v-for="(item,index) in noVipData"
										:key="index"
										:style="{ backgroundImage: `url(${imgUrlBase1}/group1/image/asf3216732176332384044052.png)` }">
										<view class="jiesheng">
											<view>{{ item.vipName }}</view>
										</view>
										<view class="lisheng" v-if='item.monthlyEnabled==1'>
											<view class="tehui" v-if="item.monthlyDiscountEnabled == 1">包月首开特惠</view>
											{{item.monthlyDiscountEnabled == 1?'立省':'包月'}}
											￥{{ item.monthlyDiscountEnabled == 1 ? (item.monthlyPrice-item.monthlyDiscountPrice).toFixed(2) : item.monthlyPrice.toFixed(2)}}
										</view>
										<view class="lisheng" v-else-if='item.quarterlyEnabled==1'>
											<view class="tehui" v-if="item.quarterlyDiscountEnabled == 1">包季首开特惠</view>
											{{item.quarterlyDiscountEnabled == 1?'立省':'包季'}}
											￥{{ item.quarterlyDiscountEnabled == 1 ? (item.quarterlyPrice-item.quarterlyDiscountPrice).toFixed(2) : item.quarterlyPrice.toFixed(2)}}
										</view>
										<view class="lisheng" v-else-if='item.halfEnabled==1'>
											<view class="tehui" v-if="item.halfDiscountEnabled == 1">包半年首开特惠</view>
											{{item.halfDiscountEnabled == 1?'立省':'包半年'}}
											￥{{ item.halfDiscountEnabled == 1 ? (item.halfPrice-item.halfDiscountPrice).toFixed(2) : item.halfPrice.toFixed(2)}}
										</view>
										<view class="lisheng" v-else-if='item.yearlyEnabled==1'>
											<view class="tehui" v-if="item.yearlyDiscountEnabled == 1">包年首开特惠</view>
											{{item.yearlyDiscountEnabled == 1?'立省':'包年'}}
											￥{{ item.yearlyDiscountEnabled == 1 ? (item.yearlyPrice-item.yearlyDiscountPrice).toFixed(2) : item.yearlyPrice.toFixed(2)}}
										</view>
									</swiper-item>
								</swiper>
							</view> -->
						</view>
						<!-- 订单+爱车 -->
						<!-- https://oos-cn.ctyunapi.cn/front-end/static/static/home_icon_2.png -->
						<view class="car">
							<view class="car_order">
								<view class="order-in">
									<image :src="(mixIconList[0] && mixIconList[0].icon)"/>
								</view>
								<view class="order-in" @tap="goOrder">
									<view class="order-dan">我的订单</view>
									<view class="header-details">查看详情</view>
								</view>
							</view>

							<!-- #V2G功能 -->
							<view v-if="isV2GOption" class="car_order car_order_v2g">
								<view class="order-in">
									<image :src="(mixIconList[0] && mixIconList[0].icon)"/>
								</view>
								<view class="order-in" @tap="goDischargeOrder">
									<view class="order-dan">放电订单</view>
									<view class="header-details">查看详情</view>
								</view>
							</view>

							<view class="car_order" @tap="goCarList">
								<view class="order-in">
									<image class="imagse-left" :src="(mixIconList[1] && mixIconList[1].icon)"/>
								</view>
								<view class="order-in">
									<view class="order-dan">我的爱车</view>
									<view class="header-details">绑定车辆</view>
								</view>
								<view class="order-in order-in-icon">
									<image class="imagse-right add-car-icon" :src="(mixIconList[2] && mixIconList[2].icon)"/>
								</view>
							</view>
						</view>
					</view>
					<!-- 已登录 B -->
					<view v-else-if="isLogin && personage.memberType == 0">
						<view class="login-default login-self" style="height: 153rpx">
							<!--  https://oos-cn.ctyunapi.cn/front-end/static/static/header.png-->
							<view class="header">
								<image :class="personage.icon?'header-image1':'header-image2'" :src="personage.icon"/>
							</view>
							<view class="header-div">
								<!-- #ifdef MP-WEIXIN || H5 || MP-ALIPAY -->
								<!-- <view class="header-login" v-if="personage.name">{{ personage.name }}</view> -->
								<!-- 产品周向荣需求 修改用户名称为手机号码并且只读 -->
								<view class="header-login">{{ telephoneRead }}</view>
								<!-- #endif -->
								<!-- #ifdef APP-PLUS -->
								<!-- <view class="header-login" v-if="personage.name">{{personage.name}}
								</view> -->
								<view class="header-login">{{ telephoneRead }}</view>
								<!-- #endif -->
							</view>
							<view>
								<!--<view class="goout" @tap="Logout">注销</view>-->
								<view v-if="personage.groupName" class="switchType" @click="switchUserType">
									<image src="https://oos-cn.ctyunapi.cn/front-end/static/static/switch3.png" />身份切换
									<!-- <image src="https://oos-cn.ctyunapi.cn/front-end/static/static/switch2.png" />身份切换 -->
								</view>
							</view>
						</view>

						<!-- 营销获客处理 -->
						<growMemberCard :marketingAllMemberInfo="marketingAllMemberInfo" :personage="personage"/>


						<!-- 个人账户 -->
						<view class="account-self">
							<view class="account-center">
								<view class="account-in" @tap="goPersonalAccount">
									<view class="account-number">{{ personage.accountBalance }}</view>
									<p>账户余额(元)</p>
									<!--<view class="recharge">去充值</view>-->
								</view>
								<view v-if="prepaidCardSwitch" class="account-in">
									<view class="account-number">{{ cardBalance }}</view>
									<p>储值卡金额(元)</p>
								</view>

								<template v-if="marketingSwitch">
									<view class="account-in" @tap="naviCardYxhk">
										<view class="account-number">{{ notUseCount }}</view>
										<p>卡券</p>
										<!-- <view class="past" v-if="expireCount != 0">
											{{ expireCount }}张快过期
										</view> -->
										<!-- 卡券接口未通暂时写死为0 -->
										<!-- <view class="account-number">0</view> -->
										<!-- <p>卡券</p> -->
									</view>
									<view class="account-in" @tap="naviIntegral">
										<view class="account-number">{{ marketingAllMemberInfo.integral }}</view>
										<p>积分</p>
									</view>
								</template>
								<template v-else>
									<view class="account-in" @tap="naviCard">
										<view class="account-number">{{ personage.couponList }}</view>
										<p>卡券</p>
										<view v-if="personage.expiringSoonCoupon" class="past">
											{{ personage.expiringSoonCoupon }}张快过期
										</view>
									</view>
									<!-- 				<view class="account-in" @tap="naviIntegral">
										<view class="account-number">{{ personage.consumeIntegral }}</view>
										<p>积分</p>
									</view> -->
								</template>
							</view>
						</view>
						
						<!-- 付费会员先隐藏 -->
						<template v-if="marketingSwitch">
							<!-- 未购买会员 -->
							<view v-if="menberData&&noVipData.length!=0&&menberData.length==0" class="noVip">
								<view>
									<swiper :autoplay="true" circular class="swiperBox" :duration="duration"
										:indicator-dots="indicatorDots">
										<swiper-item v-for="(item,index) in noVipData" :key="index" class="swipersItem"
											:style="{ backgroundImage: `url(${imgUrlBase1}/group1/image/asf3216732176332384044052.png)` }"
											@click="toBuyVip(item)">
											<view class="jiesheng">
												<view>{{ item.vipName }}</view>
											</view>
											<view v-if='item.monthlyEnabled===1 && item.monthlyDiscountEnabled===1' class="lisheng">
												<view v-if="item.monthlyDiscountEnabled == 1" class="tehui">包月首开特惠</view>
												{{item.monthlyDiscountEnabled == 1?'立省':'包月'}}
												￥{{ (item.monthlyPrice-item.monthlyDiscountPrice) | toFixedF  }}
											</view>
											<view v-else-if='item.quarterlyEnabled===1&&item.quarterlyDiscountEnabled===1' class="lisheng">
												<view v-if="item.quarterlyDiscountEnabled == 1" class="tehui">包季首开特惠</view>
												{{item.quarterlyDiscountEnabled == 1?'立省':'包季'}}
												￥{{ (item.quarterlyPrice-item.quarterlyDiscountPrice) | toFixedF  }}
											</view>
											<view v-else-if='item.halfEnabled===1&&item.halfDiscountEnabled===1' class="lisheng">
												<view v-if="item.halfDiscountEnabled == 1" class="tehui">包半年首开特惠</view>
												{{item.halfDiscountEnabled == 1?'立省':'包半年'}}
												￥{{ (item.halfPrice - item.halfDiscountPrice) | toFixedF  }}
											</view>
											<view v-else-if='item.yearlyEnabled==1&&item.yearlyDiscountEnabled==1' class="lisheng">
												<view v-if="item.yearlyDiscountEnabled == 1" class="tehui">包年首开特惠</view>
												{{item.yearlyDiscountEnabled == 1?'立省':'包年'}}
												￥{{ (item.yearlyPrice - item.yearlyDiscountPrice) | toFixedF  }}
											</view>
											<view v-else-if='item.monthlyEnabled===1' class="lisheng">
												<view v-if="item.monthlyDiscountEnabled == 1" class="tehui">包月首开特惠</view>
												{{item.monthlyDiscountEnabled == 1?'立省':'包月'}}
												￥{{ (item.monthlyPrice) | toFixedF  }}
											</view>
											<view v-else-if='item.quarterlyEnabled===1' class="lisheng">
												<view v-if="item.quarterlyContinuousEnabled == 1" class="tehui">包季首开特惠</view>
												{{item.quarterlyContinuousEnabled == 1?'立省':'包季'}}
												￥{{ (item.monthlyPrice) | toFixedF  }}
											</view>
											<view v-else-if='item.halfEnabled===1' class="lisheng">
												<view v-if="item.halfContinuousEnabled == 1" class="tehui">包半年首开特惠</view>
												{{item.halfContinuousEnabled == 1?'立省':'包半年'}}
												￥{{ (item.monthlyPrice) | toFixedF  }}
											</view>
											<view v-else-if='item.yearlyEnabled==1' class="lisheng">
												<view v-if="item.yearlyContinuousEnabled == 1" class="tehui">包年首开特惠</view>
												{{item.yearlyContinuousEnabled == 1?'立省':'包年'}}
												￥{{ (item.monthlyPrice) | toFixedF  }}
											</view>
										</swiper-item>
									</swiper>
								</view>
							</view>
							<!-- 已购买会员 -->
							<view v-if="menberData&&menberData.length!=0" class="isVip">
								<!-- menberData -->
								<view class="lvList" :style="{ backgroundImage: `url(${imgUrlBase}/dsaf1231218487223508185245.png)` }">
									<scroll-view class="swiperBox" scroll-x="true" style="white-space: nowrap;position:relative"
										@scroll="scroll">
										<view v-for="(item,index) in menberData" :key="index" class="swipersItem"
											style="width:49%;display: inline-block;" @click="toHasVip(item)">
											<view style="color: #FFFFFF;display:flex;align-items: center;">
												<image :src="lv1Icon" style="width: 90rpx;height:90rpx"/>
												{{item.vipName}}会员
											</view>
										</view>
										<view v-if="isShow&&menberData.length>2" class="u-icon-right" @click="tip">
											<u-icon color="#FFFFFF" name="arrow-right" size="28"/>
										</view>
									</scroll-view>
								</view>
								<!-- 								<view class="lvBottom">
											<view>
													<view>LV1累计已</view>
													<view>省1992.22元</view>
											</view>  
											<view>权益中心</view>
									</view> -->
							</view>
						</template>
						<!-- 订单+爱车 -->
						<view class="car car_self">
							<view class="car_order">
								<!-- https://oos-cn.ctyunapi.cn/front-end/static/static/home_icon_2.png -->
								<view class="order-in">
									<image :src="(mixIconList[0] && mixIconList[0].icon)"/>
								</view>
								<view class="order-in" @tap="goOrder">
									<view class="order-dan">我的订单</view>
									<view class="header-details">
										<p>
											{{ personage.chargingBillNumber > 0?'充电中':(personage.notPayBillNumber > 0?'待支付':( personage.notCommentBillNumber > 0?'待评价':'去查看')) }}
										</p>
										<image class="turn" src="https://oos-cn.ctyunapi.cn/front-end/static/static/turn.png"/>
										<view v-if="personage.notPayBillNumber > 0 || personage.chargingBillNumber > 0 || personage.notCommentBillNumber > 0"
											class="order-number">
											{{ personage.chargingBillNumber > 0?personage.chargingBillNumber:(personage.notPayBillNumber > 0?personage.notPayBillNumber:( personage.notCommentBillNumber > 0?personage.notCommentBillNumber:'')) }}
										</view>
									</view>
								</view>
							</view>

							<!-- #V2G功能 -->
							<view v-if="isV2GOption" class="car_order car_order_v2g">
								<view class="order-in">
									<image :src="(mixIconList[0] && mixIconList[0].icon)"/>
								</view>
								<view class="order-in" @tap="goDischargeOrder">
									<view class="order-dan">放电订单</view>
									<view class="header-details">
										<p>
											{{ personage.disChargeBillNumber > 0?'放电中':(personage.notDisChargePayBillNumber > 0?'待支付':( personage.notDisChargeCommentBillNumber > 0?'待评价':'去查看')) }}
										</p>
										<image class="turn" src="https://oos-cn.ctyunapi.cn/front-end/static/static/turn.png"/>
										<view v-if="personage.notDisChargePayBillNumber > 0 || personage.disChargeBillNumber > 0 || personage.notDisChargeCommentBillNumber > 0"
											class="order-number">
											{{ personage.disChargeBillNumber > 0?personage.disChargeBillNumber:(personage.notDisChargePayBillNumber > 0?personage.notDisChargePayBillNumber:( personage.notDisChargeCommentBillNumber > 0?personage.notDisChargeCommentBillNumber:'')) }}
										</view>
									</view>
								</view>
							</view>

							<view class="car_order" @tap="goCarList">
								<!-- https://oos-cn.ctyunapi.cn/front-end/static/static/mine_icon2.png -->
								<view class="order-in">
									<image class="imagse-left" :src="(mixIconList[1] && mixIconList[1].icon)"/>
								</view>
								<view class="order-in">
									<view class="order-dan">我的爱车</view>
									<view class="header-details">{{ personage.plateNo ? personage.plateNo : '绑定车辆' }}
									</view>
								</view>
								<view class="order-in order-in-icon">
									<!--https://oos-cn.ctyunapi.cn/front-end/static/static/add.png -->
									<image class="imagse-right add-car-icon" :src="(mixIconList[2] && mixIconList[2].icon)"/>
								</view>
							</view>
						</view>
					</view>
					<!-- 车队登录 C -->
					<view v-else-if="(isLogin && personage.memberType == 1) || personage.memberType == 2">
						<view class="login-default login-self login-car">
							<view class="header">
								<!--<image v-if="personage.servicePackage.iconAddress" :src="personage.servicePackage.iconAddress" class="header-image1"></image>-->
								<image
									class="header-image"
									:src="sellerNo=='jw'?'https://oos-cn.ctyunapi.cn/front-end/static/mine/images/header-blue.png':'https://oos-cn.ctyunapi.cn/front-end/static/cartoon/header.png'"/>
							</view>
							<view class="header-div">
								<!--<view class="header-login">{{ personage.motorcadeName }}</view>-->
								<view class="header-login">
									{{ personage.telephone && telephoneRead }}
								</view>
								<view class="header-text">
									<!--<image src="https://oos-cn.ctyunapi.cn/front-end/static/static/team.png"></image>-->
									<text>{{ personage.groupName }}</text>
								</view>
							</view>
							<view>
								<!--<view class="goout" @tap="Logout">注销</view>-->
								<view v-if="personage.groupName" class="switchType" @click="switchUserType">
									<image src="https://oos-cn.ctyunapi.cn/front-end/static/static/switch3.png" />身份切换
									<!-- <image src="https://oos-cn.ctyunapi.cn/front-end/static/static/switch2.png" />身份切换 -->
								</view>
							</view>
						</view>

						<growMemberCard :marketingAllMemberInfo="marketingAllMemberInfo" :personage="personage"/>

						<!-- 车队个人账户 -->
						<view class="account-car">
							<view class="account-center">
								<!--<view class="account-in" @tap="goPersonalAccount">-->
								<!--<view class="account-number account-orange">{{ personage.accountBalance }}</view>-->
								<!--<p>个人账户</p>-->
								<!--<view class="recharge">去充值</view>-->
								<!--</view>-->
								<view class="account-in" @tap="goPersonalAccount1">
									<view class="account-number">
										{{ personage.deductMode == 'TeamAccount' ? '****' : personage.carAccountBalance }}
									</view>
									<p>账户余额(元)</p>
								</view>

								<view v-if="prepaidCardSwitch" class="account-in">
									<view class="account-number">{{ cardBalance }}</view>
									<p>储值卡金额(元)</p>
								</view>

								<template v-if="marketingSwitch">
									<view class="account-in" @tap="naviCardYxhk">
										<view class="account-number">{{ notUseCount }}</view>
										<p>卡券</p>
										<!-- <view class="past" v-if="expireCount != 0">
											{{ expireCount }}张快过期
										</view> -->
										<!-- 卡券接口未通暂时写死为0 -->
										<!-- <view class="account-number">0</view> -->
										<!-- <p>卡券</p> -->
									</view>
									<!-- 					<view class="account-in" @tap="naviIntegralYx">
										<view class="account-number">{{ marketingAllMemberInfo.integral }}</view>
										<p>积分</p>
									</view> -->
								</template>
								<template v-else>
									<view class="account-in" @tap="naviCardYxhk">
										<view class="account-number">{{ personage.couponList}}</view>
										<p>卡券</p>
										<view v-if="personage.expiringSoonCoupon" class="past">
											{{ personage.expiringSoonCoupon }}张快过期
										</view>
									</view>
									<!-- <view class="account-in" @tap="naviIntegral">
										<view class="account-number">{{ personage.consumeIntegral }}</view>
										<p>积分</p>
									</view> -->
								</template>
								<!-- <view class="account-in" @tap="naviIntegral">
								<view class="account-number">{{ personage.consumeIntegral }}</view>
								<p>积分</p>
								</view> -->
							</view>
						</view>
						<!-- 订单+爱车 -->
						<view class="car car_self">
							<view class="car_order">
								<!--  https://oos-cn.ctyunapi.cn/front-end/static/static/home_icon_2.png-->
								<view class="order-in">
									<image :src="(mixIconList[0] && mixIconList[0].icon)"/>
								</view>
								<view class="order-in" @tap="goOrder">
									<view class="order-dan">我的订单</view>
									<view class="header-details">
										<p>
											{{ personage.chargingBillNumber > 0?'充电中':(personage.notPayBillNumber > 0?'待支付':( personage.notCommentBillNumber > 0?'待评价':'去查看')) }}
										</p>
										<image class="turn" src="https://oos-cn.ctyunapi.cn/front-end/static/static/turn.png"/>
										<view v-if="personage.notPayBillNumber > 0 || personage.chargingBillNumber > 0 || personage.notCommentBillNumber > 0"
											class="order-number">
											{{ personage.chargingBillNumber > 0?personage.chargingBillNumber:(personage.notPayBillNumber > 0?personage.notPayBillNumber:( personage.notCommentBillNumber > 0?personage.notCommentBillNumber:'')) }}
										</view>
									</view>
								</view>
							</view>

							<!-- #V2G功能 -->
							<view v-if="isV2GOption && personage.memberType == 0" class="car_order car_order_v2g">
								<view class="order-in">
									<image :src="(mixIconList[0] && mixIconList[0].icon)"/>
								</view>
								<view class="order-in" @tap="goDischargeOrder">
									<view class="order-dan">放电订单</view>
									<view class="header-details">
										<p>
											{{ personage.disChargeBillNumber > 0?'放电中':(personage.notDisChargePayBillNumber > 0?'待支付':( personage.notDisChargeCommentBillNumber > 0?'待评价':'去查看')) }}
										</p>
										<image class="turn" src="https://oos-cn.ctyunapi.cn/front-end/static/static/turn.png"/>
										<view v-if="personage.notDisChargePayBillNumber > 0 || personage.disChargeBillNumber > 0 || personage.notDisChargeCommentBillNumber > 0"
											class="order-number">
											{{ personage.disChargeBillNumber > 0?personage.disChargeBillNumber:(personage.notDisChargePayBillNumber > 0?personage.notDisChargePayBillNumber:( personage.notDisChargeCommentBillNumber > 0?personage.notDisChargeCommentBillNumber:'')) }}
										</view>
									</view>
								</view>
							</view>

							<view class="car_order" @tap="goCarList">
								<!--  https://oos-cn.ctyunapi.cn/front-end/static/static/mine_icon2.png-->
								<view class="order-in">
									<image class="imagse-left" :src="(mixIconList[1] && mixIconList[1].icon)"/>
								</view>
								<view class="order-in">
									<view class="order-dan">我的爱车</view>
									<view class="header-details">{{ personage.plateNo ? personage.plateNo : '暂无' }}
									</view>
								</view>
								<view class="order-in order-in-icon">
									<!-- https://oos-cn.ctyunapi.cn/front-end/static/static/add.png -->
									<image class="imagse-right add-car-icon" :src="(mixIconList[2] && mixIconList[2].icon)"/>
								</view>
							</view>
						</view>
					</view>
				</view>

				<!-- 活动轮播  根据后台返回 判断是是否显示 -->
				<view v-if="info.length" class="active">
					<swiper :autoplay="autoplay" class="activ-in" :duration="duration" indicator-active-color="#FFFFFF"
						indicator-col="#FEA48F" :indicator-dots="indicatorDots" :interval="interval" next-margin="-1rpx">
						<block v-for="(item, index) in info" :key="index">
							<swiper-item>
								<image class="swiperitem" :data-item="item" :src="item.image" @tap="naviActivity"/>
							</swiper-item>
						</block>
					</swiper>
				</view>

				<!-- 必展示的内容 -->
				<view>
					<view :class="'icons ' + (isLogin && !activ ? 'activityMargins' : '')">
						<view class="icons-in" @tap="goCollectionList">
							<image class="icons-img" :src="(mixIconList[3] && mixIconList[3].icon)"
								style="width: 104rpx; height: 103rpx"/>
							<p>站点收藏</p>
						</view>
						<view v-if="enabledState && personage.memberType == 0 && isLogin" class="icons-in" @tap="invoice">
							<!-- https://oos-cn.ctyunapi.cn/front-end/static/static/mine_icon4.png -->
							<image class="icons-img" :src="(mixIconList[4] && mixIconList[4].icon)"
								style="width: 101rpx; height: 106rpx"/>
							<p>发票开具</p>
						</view>
						<view v-if="personage.memberType == 0" class="icons-in" @tap="getBill">
							<image class="icons-img" :src="(mixIconList[5] && mixIconList[5].icon)"
								style="width: 100rpx; height: 104rpx"/>
							<p>我的账单</p>
						</view>
						<!-- <view class="icons-in growthCenter" @tap="linkGrowthCenter">
							<image :src="chengzhangzhongxin" class="icons-img" style="width: 100rpx; height: 104rpx">
							</image>
							<view class="tips">赢好礼</view>
							<p>成长中心</p>
						</view> -->
						<view class="icons-in" @tap="linkCollectingVouchers">
							<image class="icons-img" :src="sellerNo=='aikc' ? lingquanzhongxin2 : lingquanzhongxin" style="width: 100rpx; height: 104rpx"/>
							<p>领券中心</p>  
						</view>
						<!-- <view class="icons-in" @tap="linkFlashKill">
							<image :src="chaojimiaosha" class="icons-img" style="width: 100rpx; height: 104rpx"></image>
							<p>超级秒杀</p>
						</view>
						<view class="icons-in" @tap="linkPointsMall" >
							<image :src="jifenshangcheng" class="icons-img" style="width: 100rpx; height: 104rpx">
							</image>
							<p>积分商城</p>
						</view> -->
						<!-- 2023.8.8 目前用不到这个功能先注释了 -->
						<!-- <view class="icons-in" @tap="toPromotion" v-if="marketingSwitch && isToken">
							<image :src="mixIconList[6] && mixIconList[6].icon" class="icons-img"
								style="width: 100rpx; height: 104rpx"></image>
							<p>推广中心</p>
						</view> -->
						
						<view v-if="isToken && marketingSwitch && linkMallUrl && isOpenDev && personage.memberType == 0" class="icons-in" @tap="goIntegralMall">
							<image class="icons-img" :src="jifenshangcheng" style="width: 100rpx; height: 104rpx"/>
							<p>积分商城</p>
						</view>


						<!-- 	<view class="icons-in" @tap="linkage" :data-index="1" >
							<image
								:src="(mixIconList[7] && mixIconList[7].icon)"
								class="icons-img" style="width: 100rpx; height: 104rpx"></image>
							<p>客服</p>
						</view> -->

						<!-- <view class="icons-in" @tap="goGroup" v-if="marketingSwitch && isToken">
							<image src="http://oos-cn.ctyunapi.cn/front-end/static/marketingImg/static/icon_4.png" class="icons-img"
								style="width: 100rpx; height: 104rpx"></image>
							<p>我的拼团</p>
						</view> -->

						<!-- 昊易充做别的小程序跳转 -->
						<view v-if="sellerNo=='hyc'&& (personage.memberType==1 || personage.memberType==2)" class="icons-in"
							@tap="goGroupAdmin">
							<image class="icons-img" src="http://oos-cn.ctyunapi.cn/front-end/static/marketingImg/static/icon_4.png"
								style="width: 100rpx; height: 104rpx"/>
							<p>车队管理</p>
						</view>
						
						<!-- 电池安全报告 -->
						<view v-if="batteryCheckSwitch" class="icons-in" @tap="goBatteryTestingList">
							<image class="icons-img" src="http://oos-cn.ctyunapi.cn/front-end/static/marketingImg/static/icon_4.png"
								style="width: 100rpx; height: 104rpx"/>
							<p>电池安全报告</p>
						</view>



						<!-- 	<view class="icons-in" @tap="linkage" :data-index="0">
							<image
								:src="(mixIconList[8] && mixIconList[8].icon)"
								class="icons-img" style="width: 100rpx; height: 104rpx"></image>
							<p>设置</p>
						</view> -->
						<!-- 2023.8.8 目前用不到这个功能先注释了 -->

						<!-- <view class="icons-in" @tap="toPromotion" v-if="isToken && marketingSwitch && sellerNo!='tjhz'">   
						 <image :src="(mixIconList[6] && mixIconList[6].icon)"
								class="icons-img" style="width: 100rpx; height: 104rpx"></image>
							<p>推广中心</p>
						</view> -->

						<!-- #V2G功能 -->
						<view v-if="isV2GOption && personage.memberType == 0" class="icons-in" @tap="getV2g">
							<image class="icons-img" :src="(mixIconList[5] && mixIconList[5].icon)"
								style="width: 100rpx; height: 104rpx"/>
							<p>放电设置</p>
						</view>

						<!-- 绑定充电卡 -->
						<view v-if="isLogin && isSellerXc() && personage.memberType == 0" class="icons-in" @tap="goChargeCard">
							<image class="icons-img" :src="(mixIconList[10] && mixIconList[10].icon)"
								style="width: 100rpx; height: 104rpx"/>
							<p>绑定充电卡</p>
						</view>
					</view>
				</view>
				<view class="serverAndSetting">
					<view v-if="marketingSwitch && isToken && !isTjhz()" :data-index="0" @tap="toPromotion">
						<view>
							<u-icon color="#606266" name="volume" size="40"/>
							<view class="title">
								推广中心
							</view>
						</view>
						<view class="tuiguang"><text>推广有礼</text></view>
						<u-icon color="#606266" name="arrow-right" size="40"/>
					</view>

					<view :data-index="1" @tap="linkage">
						<view>
							<u-icon color="#606266" name="server-man" size="40"/>
							<view class="title">客服</view>
						</view>
						<u-icon color="#606266" name="arrow-right" size="40"/>
					</view>
					<view :data-index="0" @tap="linkage">
						<view>
							<u-icon color="#606266" name="setting" size="40"/>
							<view class="title">设置</view>
						</view>
						<u-icon color="#606266" name="arrow-right" size="40"/>
					</view>
				</view>
				<!-- 列表项 -->
				<!--<view class="list">-->
				<!--<view class="list-in" @tap="linkage" :data-index="index" v-for="(item, index) in list" :key="index">-->
				<!--<view>-->
				<!--<image :src="item.urlleft" class="urlleft"></image>-->
				<!--</view>-->

				<!--<view>{{ item.test }}</view>-->

				<!--<view>-->
				<!--<image :src="item.urlright" class="urlright"></image>-->
				<!--</view>-->
				<!--</view>-->
				<!--</view>-->
			</view>
			<!-- 头部 end -->

			<!-- 活动弹窗 -->
			<shadePopup :show="showCoupons2" @close="onActivityClose">
				<view class="coupons2">
					<swiper :autoplay="autoplayCoupons2" class="coupons2-swiper" :duration="durationCoupons2"
						indicator-active-color="#FFFFFF" indicator-col="#FEA48F" :indicator-dots="indicatorDotsCoupons2"
						:interval="intervalCoupons2">
						<!-- <view class="coupons2-swiper-item-list" > -->
						<swiper-item v-for="(item, index) in couponImgList" :key="index" class="coupons2-swiper-item"
							:data-item="item" @tap="naviActivity($event,'shadePopup')">
							<image class="swiperitem" :src="item.image"/>
						</swiper-item>
						<!-- </view> -->
					</swiper>
				</view>
			</shadePopup>

			<!--切换身份-->
			<UserTypePopup ref="UserTypePopup" :deductMode="personage.deductMode" :userType="personage.memberType"
				@dialogConfirm="dialogConfirm"/>

			<!-- 下端导航栏 -->
			<Tabbar :currentPage="4"/>
		</view>
	</view>
</template>

<script>
	'use strict';
	import Tabbar from '../../components/tabbar/tabbar';
import shadePopup from '@/components/shadePopup/shadePopup';

	import payMemberCard from '@/components/payMemberCard/index';
import growMemberCard from '@/components/growMemberCard/index';
import UserTypePopup from '@/components/switchUserType/userTypePopup';

	// exports.__esModule = true; // pages/my/my.ts

	var app = getApp();

	var https_1 = require("../../api/https");
	var util_1 = require("../../utils/util");
	var coupon_1 = require("../../api/marketing/coupon");
	var promotion_1 = require("../../api/marketing/promotion");
	var defaultAvatarUrl = 'https://oos-cn.ctyunapi.cn/front-end/static/marketingImg/static/photo.png';



	import {
	getMarketingAllMemberInfo
} from '../../api/marketing/marketing';
import {
	getPromoterDetail
} from '../../api/marketing/promotion';
import {
	noVipDetail,
	myVipDetail,
	cardCouponNumQuery
} from '../../api/marketing/vip';
import { queryCardBalance } from "@/api/storedCard.js";


	import customNavigationBar from '@/components/customNavigationBar/customNavigationBar';
	export default {
		components: {
			Tabbar,
			shadePopup,
			UserTypePopup,
			customNavigationBar,

			payMemberCard,
			growMemberCard,
		},
		data() {
			return {
				telephoneRead:'',
				linkMallUrl:app.globalData.pointsMallUrl,
				imgUrlBase1: app.globalData.imgUrl,
				imgUrlBase: `${app.globalData.imgUrl}/group1/image`,
				lv1Icon: `${app.globalData.imgUrl}/group1/operateSchemeImage/image/LVONE.png`,
				lv2Icon: `${app.globalData.imgUrl}/group1/operateSchemeImage/image/LVTWO.png`,
				menberData: null,
				noVipData: [],
				chengzhangzhongxin: `${app.globalData.imgUrl}/group1/operateSchemeImage/image/mine_icon_tuiguang.png`,
				lingquanzhongxin: `${app.globalData.imgUrl}/group1/operateSchemeImage/image/mine_lingquanzhongxin.png`,
				lingquanzhongxin2: `${app.globalData.imgUrl}/group1/operateSchemeImage/image/lqzx.png`,
				chaojimiaosha: `${app.globalData.imgUrl}/group1/operateSchemeImage/image/mine_chaojimiaosha.png`,
				jifenshangcheng: `${app.globalData.imgUrl}/group1/operateSchemeImage/image/mine_jifenshangcheng.png`,
				marketingApiError: null,
				// 旧版成长等级列表
				marketingAllMemberInfo: {},
				levelList: ['银卡', '金卡', '白金', '钻石', '黑金'],

				isToken: false,
				marketingSwitch: true,
				unpaidOrderNum: 0,
				enabledState: false,
				isLogin: false,
				loading: true,
				hideBg: true,
				hideHeaderA: false,
				hideHeaderB: false,
				hideHeaderC: false,
				hideActiv: false,
				hideIcons: false,
				hideList: false,

				personage: {
					name: '',
					icon: '',
					memberType: 0,
					level: 0,
					gap: '',
					accountBalance: '0',
					couponList: '',
					expiringSoonCoupon: '0',
					consumeIntegral: '',
					notPayBillNumber: 0,
					plateNo: false,
					motorcadeName: '',
					percentage: '0',
					deductMode: 'TeamAccount',
					carAccountBalance: '0'
				},

				account: 0,
				motorcade: {},
				activ: false,
				info: [],
				indicatorDots: true,
				vertical: false,
				autoplay: true,
				interval: 3000,
				duration: 500,

				list: [
					// {
					//     urlleft: 'https://oos-cn.ctyunapi.cn/front-end/static/static/mine_icon6.png',
					//     test: '客服',
					//     urlright: 'https://oos-cn.ctyunapi.cn/front-end/static/static/turn_left.png'
					// },
					{
						urlleft: 'https://oos-cn.ctyunapi.cn/front-end/static/static/mine_icon7.png',
						test: '设置',
						urlright: 'https://oos-cn.ctyunapi.cn/front-end/static/static/turn_left.png'
					}
				],

				// 以旧带新活动状态
				activityStatus: null,

				hideBanner: '',
				hideCustom: '',
				hideSite: '',
				widnowH: 0,
				bar_Height: 0,
				showCoupons2: false,
				indicatorDotsCoupons2: true,
				verticalCoupons2: false,
				autoplayCoupons2: false,
				intervalCoupons2: 2000,
				durationCoupons2: 500,
				couponImgList: [],
				sellerNo: null,
				accountInfo: {}, //车队账户信息

				notUseCount: '',
				expireCount: '',
				isShow: true,
				remId: null,
				headerStyle: '',
				cardBalance: '0.00', // 储值卡的金额
			};
		},
		/**
		 * 生命周期函数--监听页面加载
		 */
		onLoad: function() {
			this.setPageStyle()
			console.log(app.globalData.sellerNo, 'app.globalData.sellerNo')
		},
		onShow: function() {
			uni.hideTabBar({});
			this.getNoVipDetail();
			console.log(uni.getStorageSync('token'), 'token')
			this.sellerNo = app.globalData.sellerNo
			if (uni.getStorageSync('token')) {
				console.log(uni.getStorageSync('token'))
				this.setData({
					isLogin: true,
					isToken: true
				});
				this.getMyVipDetail();
				this.getListPopUp();
				this.getMemberInfo();
				this.getBySellerId();
				this.infos();
				this.getOldAndNewBenifit();
				this.getMyNotPayBillNumber()
				this.getPromoterDetailFun(); //获取外包会员信息
			} else {
				this.setData({
					isLogin: false,

				});
				this.infos();
			}
		},
		/**
		 * 页面相关事件处理函数--监听用户下拉动作
		 */
		onPullDownRefresh: function() {
			//调用刷新时将执行的方法
			this.onRefresh();
		},
		methods: {
			// 获取储值卡的金额
			async getCardBalance(telephone,storeCardNum) {
				const _params = {
					memberMobile: telephone,
					storeCardNum
				}
				let {data}  = await queryCardBalance(_params)
				this.cardBalance = (Number(data)/100).toFixed(2)
			},

			setPageStyle() {
				// #ifndef MP-ALIPAY
				this.headerStyle = 'padding-top:' + (this.widnowH <= 568 ? this.bar_Height + 160 : this.bar_Height + 180) + 'rpx;'
				// #endif
				// #ifdef MP-ALIPAY
				this.headerStyle = 'padding-top:' + (this.widnowH <= 568 ? 66 : 86) + 'rpx;'
				// #endif
			},

			// #V2G功能
			getV2g() {
				app.globalData.CHECK_LOGIN(function() {
					uni.navigateTo({
						url: '/mine/pages/v2g/car'
					});
				});
			},

			// 绑定充电卡
			goChargeCard() {
				uni.navigateTo({
					url: '/mine/pages/bindChargeCard/bindChargeCard'
				});
			},
			
			tip() {
				uni.showToast({
					title: '还有更多展示，请向右滑动',
					icon: 'none'
				})
			},
			scroll(e) {
				console.log(e)
				if (e.detail.scrollLeft) {
					this.isShow = false
				}
				if (e.detail.scrollLeft == 0) {
					this.isShow = true
				}
			},
			toBuyVip(row) {
				app.globalData.CHECK_LOGIN(() => {
					uni.navigateTo({
						url: "/mine/pages/vip/noVip?id=" + row.vipId,
					});
				});
			},
			toHasVip(row) {
				uni.navigateTo({
					url: `/mine/pages/vip/vipCenter`,
				});
			},
			swiperClick(row) {
				console.log(row)
			},
			getMyVipDetail() {
				myVipDetail().then((res) => {
					if (res.code == 200) {
						this.menberData = res.data
					}
				});
			},
			getNoVipDetail() {
				noVipDetail().then(res => {
					if (res.code == 200) {
						console.log(res.data, 'getNoVipDetail')
						this.noVipData = res.data.slice(0,30)
						console.log(this.noVipData, 'this.noVipData')
					}
				})
			},
			// 获取用户（付费会员，成长会员）信息
			getPromoterDetailFun() {
				getPromoterDetail({
					plUserId: uni.getStorageSync('memberId')
				}).then((res) => {
					// console.log(res.data, '外包会员信息...........', res.data.spreadStatus)
					let getPromoterDetail = res.data || {};
					this.setData({
						getPromoterDetail
					});
				});
			},

			// 获取优惠券 和 将要过期的优惠券
			cardCouponNumQuery() {
				let memberType = uni.getStorageSync('memberType')
				if (memberType != 2) {
					memberType = 1
				}
				cardCouponNumQuery(memberType).then((res) => {
					this.setData({
						notUseCount: res.data.number,
						expireCount: res.data.expire
					});
					console.log(res, '这是未使用的优惠券数量');
				});
			},
			getBySellerId: function() {
				var that = this;
				https_1.getBySellerId(app.globalData.sellerId).then(function(res) {
					console.log(res,'发票配置接口')
					if (res.code == 0) {
						that.setData({
							enabledState: res.data.enabledState && res.data.appInvoiceEnabled
						});
					}
				});
			},
			//获取未结算订单数
			getMyNotPayBillNumber: function() {
				var that = this;
				https_1.getMyNotPayBillNumber({
					prePayVer: 1
				}).then(function(res) {
					if (res.code == 0) {
						that.unpaidOrderNum = res.data
					}
				});
			},
			switchUserType() {
				// if(this.unpaidOrderNum){
				// 	uni.showModal({
				//             title: '信息提示',
				//             content: '暂不可切换身份，您有'+this.unpaidOrderNum+'笔订单未支付！',
				//             showCancel: false
				//         });
				// }else{
				this.$refs.UserTypePopup.$refs.alertDialog.open()
				// }
			},
			dialogConfirm(e) {
				this.personage.memberType = e
				uni.setStorageSync('memberType', e)
				this.$refs.UserTypePopup.$refs.alertDialog2.close()
				this.getMemberInfo();
			},
			//获取用户信息
			getMemberInfo: function() {
				uni.showLoading({
					title: '加载中...',
					mask: true
				});

				var that = this;
				https_1.getMemberInfo().then(function(res) {
					if (res.code == 0) {
						var data = res.data;
						if (data.accountBalance) {
							data.accountBalance = (data.accountBalance / 100).toFixed(2);
						} else {
							data.accountBalance = '0.00';
						}

						if (data.carAccountBalance) {
							data.carAccountBalance = (data.carAccountBalance / 100).toFixed(2);
						} else {
							data.carAccountBalance = '0.00';
						}

						uni.setStorageSync('memberId', res.data.memberId);
						uni.setStorageSync('deductMode', res.data.deductMode);
						uni.setStorageSync('userInfo', res.data)
						var account = (data.consumeIntegral / data.nextNumber) * 100;

						let personage = data;
						let level = personage.level || 1;
						personage.levelName = that.levelList[level - 1];
						personage.levelNextName = that.levelList[level] || '';

						if (!data.nextNumber) {
							account = 0
						}
						if (!data.nextNumber) {
							account = 0
						}

						// 营销获客开关
						// if(that.marketingSwitch){
						// 	that.$refs.payMemberCardRef.init()
						// }

						// if (uni.getStorageSync('memberType').toString()) {
						// 	data.memberType = uni.getStorageSync('memberType')
						// } else {
						// 	uni.setStorageSync('memberType', data.memberType)
						// }
						
						// 个人身份0 车队身份2
						uni.setStorageSync('memberType', data.tokenMemberType)
						data.memberType = data.tokenMemberType
						console.log(data.memberType, '这个是会员类型1')
						console.log(data.tokenMemberType, '这个是会员类型2')
						
						data.icon = data.icon ? data.icon : "https://oos-cn.ctyunapi.cn/front-end/static/static/header-1.png"

						that.setData({
							personage: data,
							account: account,
							telephoneRead: data.telephone.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2")
						});

						// 获取储值卡金额
						if (that.prepaidCardSwitch) {
							if(data.memberType == 1 || data.memberType==2) {
								if(data.vehicles.length) {
									let obj  = data.vehicles.find(item=>item.plateNo == data.plateNo)
									that.getCardBalance('', obj.storedCard)
								} 
							}else {
								that.getCardBalance(data.telephone)
							}
						}


						// console.log(that.personage, '我的资料------------')
						// console.log(that.telephoneRead, '手机号------------')
						that.getMarketingAllMemberInfo()
						that.getAccountInfo(data.tokenMemberType)
						that.cardCouponNumQuery();

						// //页面加载最慢的请求结束后再显示
						// that.pageApiObj = true
					}

					if (res.code == 7) {
						that.setData({
							isLogin: false
						});
					}

					if (res.code == 500) {
						that.setData({
							isLogin: false
						});
					}
				});

				uni.hideLoading()
			},
			// 活动弹窗列表
			getListPopUp: function() {
				var that = this;
				https_1
					.listPopUp()
					.then(function(res) {
						if (res.code == 0) {
							var activityData = res.data;
							var couponImgList_1 = [];

							if (activityData.length > 0) {
								activityData.forEach(function(element) {
									if (/^http/.test(element.imgUrl) && element.region == 2) {
										couponImgList_1.push({
											image: element.imgUrl,
											linkUrl: element.linkUrl,
											linkType: element.linkType,
											content: element.content,
											id: element.id,
											title: element.title,
											timeS: element.setupTime,
											status: element.status,
											statusStr: element.statusStr,
											mobilePath: element.mobilePath,
											activityType: element.activityType,
											marketingId: element.marketingId,
											appId: element.appId
										});
										that.couponImgList = couponImgList_1,
											that.showCoupons2 = true
									}
								});
							}
						}
					})['catch'](function(err) {
						console.log(err);
					});
			},
			//退出登录
			Logout: function() {
				var that = this;
				uni.showModal({
					title: '提示',
					content: '确定注销吗？',
					success: function(res) {

						if (res.confirm) {
							https_1.logout().then(function(res) {
								if (res.code == 0) {
									uni.removeStorageSync('openId');
									uni.removeStorageSync('unionId');
									uni.removeStorageSync('token');
									uni.removeStorageSync('memberType');
									that.isLogin = false
								}
							});
						}
					}
				});
			},

			//我的收藏
			goCollectionList: function() {
				app.globalData.CHECK_LOGIN(function() {
					uni.navigateTo({
						url: '../../mine/pages/collectionList/collectionList'
					});
				});
			},
			//需要提示 登录
			loginTost: function() {
				app.globalData.CHECK_LOGIN(function() {
					uni.navigateTo({
						url: '/packagePersonal/pages/login/login'
					});
				});
			},
			//登录
			login: function() {
				uni.navigateTo({
					url: '/packagePersonal/pages/login/login'
				});
			},

			// 发票
			invoice: function() {
				if(this.sellerNo=='cqym'){
					uni.showModal({
						title: '温馨提示',
						content: '开票功能升级维护中，给您带来的不便敬请谅解。详情咨询4008664008',
						showCancel: false
					 });
				}else {
					app.globalData.CHECK_LOGIN(function() {
						uni.navigateTo({
							url: '../../mine/pages/invoice/invoice'
						});
					});
				}
				
			},

			//个人账号
			goPersonalAccount: function() {
				// app.globalData.CHECK_LOGIN(function () {
				// 	uni.navigateTo({
				// 		url: '../../mine/pages/personalAccount/personalAccount?tab=1'
				// 	});
				// });
				app.globalData.CHECK_LOGIN(function() {
					uni.navigateTo({
						url: '../../mine/pages/individualAccount/individualAccount?tab=1'
					});
				});
			},

			//车队账号
			goPersonalAccount1: function() {
				let that = this
				app.globalData.CHECK_LOGIN(function() {
					if (that.accountInfo.deductMode == 'TeamAccount') {
						return uni.showToast({
							title: '暂无权限查看',
							icon: 'none',
							duration: 2000
						})
					}
					uni.navigateTo({
						url: '../../mine/pages/personalAccount/personalAccount?tab=2'
					});
				});
			},
			linkGrowthCenter() {
				app.globalData.CHECK_LOGIN(() => {
					uni.navigateTo({
						url: "../../mine/pages/vip/vip",
					});
				});
			},
			linkCollectingVouchers() {
				app.globalData.CHECK_LOGIN(() => {
					uni.navigateTo({
						url: "../../mine/pages/couponCenter/index",
					});
				});
			},
			//超级秒杀
			linkFlashKill() {
				wx.navigateToMiniProgram({
					appId: 'wxec66734a60638aa5',
					path: 'pages/activity/GoodsSeckill/index',
					extraData: { //参数
						foo: 'bar'
					},
					envVersion: 'trial', //develop 开发版 trial 体验版 release 正式版 
					success(res) {
						console.log('成功')
						// 打开成功
					}
				})
			},
			//积分商城
			linkPointsMall() {
				wx.navigateToMiniProgram({
					appId: 'wxec66734a60638aa5',
					path: 'pages/home/index',
					extraData: { //参数
						foo: 'bar'
					},
					envVersion: 'trial', //develop 开发版 trial 体验版 release 正式版 
					success(res) {
						console.log('成功')
						// 打开成功
					}
				})
			},
			linkage: function(e) {
				// app.globalData.CHECK_LOGIN(function() {
				//0:客服， 1：設置
				if (e.currentTarget.dataset.index == 0) {
					uni.navigateTo({
						url: '../../mine/pages/set/set'
					});
					// uni.navigateTo({
					//     url: '../../mine/pages/customer/customer'
					// });
				} else {
					uni.navigateTo({
						url: '../../mine/pages/customer/customer'
					});
					// uni.navigateTo({
					//     url: '../../mine/pages/set/set'
					// });
				}
				// });
			},
			toPromotion: function(e) {
				app.globalData.CHECK_LOGIN(function() {
					promotion_1.auditDetail({
						plUserId: uni.getStorageSync('memberId')
					}).then(function(res) {
						var code = res.code,
							data = res.data;
						// 审核状态：0：待审核；1：审核通过；2：审核拒绝
						if (code == 200 && data?.auditStatus === 1) {
							uni.navigateTo({
								url: '/marketing_page/pages/promotion/index/index'
							});
						} else {
							uni.navigateTo({
								url: "/marketing_page/pages/promotion/recruit_plan/recruit_plan"
							});
						}
					});
				});
			},
			
			goBatteryTestingList(){
				uni.navigateTo({
					url: '/mine/pages/batteryTestingList/batteryTestingList'
				})
			},


			//跳转到账单
			getBill: function() {
				app.globalData.CHECK_LOGIN(function() {
					uni.navigateTo({
						url: '/echartsPages/pages/bill/bill'
					});
				});
			},

			// 跳转拼团
			goGroup() {
				app.globalData.CHECK_LOGIN(() => {
					uni.navigateTo({
						url: '/marketing_page/pages/group/more/index'
					});
				});
			},

			// 车队管理 跳转另一个小程序
			goGroupAdmin() {
				uni.navigateToMiniProgram({
					// 目标小程序appid
					appId: 'wx84006793a2edd08f',
					// 目标小程序页面路径
					path: 'pages/index/index',
					// develop开发版；trial体验版；release正式版
					envVersion: 'trial',
					success(res) {
						// 打开成功
						console.log("跳转小程序成功！", res);
					}
				})
			},

			// 积分商城 跳转h5
			goIntegralMall() {
				console.log("去积分商城咯...")
				// let linkMallUrl = `http://8.134.96.187:83/h5/`
				
				let linkMallUrl = app.globalData.pointsMallUrl
				console.log('goIntegralMall====>', linkMallUrl)

				app.globalData.CHECK_LOGIN(() => {
					util_1.LinkType(linkMallUrl);
				})
			},


			//跳转到会员
			naviVip: function() {
				app.globalData.CHECK_LOGIN(function() {
					uni.navigateTo({
						url: '../../mine/pages/vip/vip'
					});
				});
			},

			//跳转到爱车列表
			goCarList: function() {
				app.globalData.CHECK_LOGIN(function() {
					uni.navigateTo({
						url: '../../mine/pages/myCarList/myCarList'
					});
				});
			},

			//跳转到账单列表
			goOrder: function() {
				app.globalData.CHECK_LOGIN(function() {
					uni.navigateTo({
						url: '../../orderSub/pages/order/order'
					});
				});
			},

			//跳转到放电订单-#V2G功能
			goDischargeOrder: function() {
				app.globalData.CHECK_LOGIN(function() {
					uni.navigateTo({
						url: '/orderSub/pages/discharge/order'
					});
				});
			},

			//跳转到积分列表
			naviIntegralYx() {
				app.globalData.CHECK_LOGIN(() => {
					uni.navigateTo({
						url: '../../mine/pages/integralYxhk/integralYxhk'
					});
				});
			},

			//跳转到卡券列表
			naviCardYxhk() {
				app.globalData.CHECK_LOGIN(() => {
					console.log('营销获客正常,走外包8081逻辑');
					uni.navigateTo({
						url: '../../mine/pages/cardVoucherYx/cardVoucherYx'
					});
				});
			},

			//跳转到卡券列表
			naviCard: function() {
				app.globalData.CHECK_LOGIN(function() {
					uni.navigateTo({
						url: '../../mine/pages/cardVoucher/cardVoucher'
					});
				});
			},

			//跳转到积分列表
			naviIntegral: function() {
				app.globalData.CHECK_LOGIN(function() {
					uni.navigateTo({
						url: '/echartsPages/pages/integral/integral'
					});
				});
			},

			// 活动轮播
			naviActivity: function(e, type) {
				var that = this;
				var item = e.currentTarget.dataset.item;
				// this.getReadPopUp(item);

				//登录后才记录阅读
				if (uni.getStorageSync('token')) {
					that.getReadPopUp(item);
				}

				console.log(item)
				// app.globalData.CHECK_LOGIN(function() {
				if (item.linkType == 1) {
					app.globalData.CHECK_LOGIN(() => {
						// #ifdef MP-WEIXIN
						util_1.LinkType(item.linkUrl);
						// #endif

						// #ifdef APP-PLUS
						let linkUrl = decodeURI(item.linkUrl + '&time=' + item.timeS + '&status=' + item
							.status + '&title=' + item.title)
						plus.runtime.openURL(encodeURI(linkUrl))
						// #endif
					})
				} else if (item.linkType == 2) {
					app.globalData.richText = item.content;
					if (type == 'shadePopup') {
						// 修复活动弹窗列表bug，因为item.status：2是发布中，跟其他活动冲突，所以手动将状态改成1
						uni.navigateTo({
							url: `../../homeSub/pages/advertisDetails/advertisDetails2?title=` + item.title +
								'&time=' + item.timeS + '&status=1'
						});
						return
					}
					uni.navigateTo({
						url: `../../homeSub/pages/advertisDetails/advertisDetails2?title=` + item
							.title + '&time=' + item.timeS + '&status=' + item.status
					});
				} else if (item.linkType == 4) {
					// 处理营销获客逻辑  
					that.disposeMarketingActivity(item.activityType, item.marketingId);
					that.getReadPopUp(item.id);
				} else if (item.linkType == 5) {
					app.globalData.CHECK_LOGIN(() => {
						util_1.LinkType(item.mobilePath);
					})
				} else if (item.linkType == 6) {
					let toParams = {}
					if (item.appId) {
						toParams = {
							appId: item.appId,
							path: item.linkUrl
						}
					} else {
						toParams = { shortLink: item.linkUrl }
					}
					wx.navigateToMiniProgram({
						...toParams,
						fail: err=>{
							console.error(err, item.appId, item.linkUrl);
						}
					})
				} else {
					app.globalData.CHECK_LOGIN(() => {
						return false;
					})
				}
				// });

			},
			// 处理营销活动
			disposeMarketingActivity(activityType, marketingId) {
				console.log(activityType, marketingId);
				switch (activityType) {
					// activityType:  1 => 充值奖励活动, 2 => 累计活动, 3 => 单笔折扣活动, 4 => 站点优惠活动,
					// 5 => 邀请奖励, 6 => 新客有礼, 7=> 多人拼团 8=>付费会员 9=>推广员  10=>首充有礼
					// marketingId: 活动id
					case 1:
						uni.navigateTo({
							url: '/marketing_page/pages/pay/payAward/payAward?HD=' + marketingId
						});
						break;
					case 2:
						uni.navigateTo({
							url: '/homeSub/pages/discount/cumulativeMoney/cumulativeMoney?HD=' + marketingId
						});
						break;
					case 3:
						uni.navigateTo({
							url: '/homeSub/pages/discount/singleMoney/singleMoney?HD=' + marketingId
						});
						break;
					case 4:
						uni.navigateTo({
							url: '/homeSub/pages/discount/siteOffers/siteOffers?HD=' + marketingId
						});
						break;
					case 5:
						// uni.navigateTo({
						// 	url: '/marketing_page/pages/invite/invitation/invitation?HD=' + marketingId
						// });
						app.globalData.CHECK_LOGIN(() => {
							uni.navigateTo({
								url: '/marketing_page/pages/invite/invitation/invitation?HD=' + marketingId
							});
						})
						break;
					case 6:
						console.log('弹出新客有礼弹窗;;;;');
						// uni.navigateTo({
						// 	url: '/main/pages/couponCenter/index?id='+ marketingId
						// });
						break;
					case 7:
						uni.navigateTo({
							url: '/marketing_page/pages/group/list/index'
						});
						break;
					case 8:
						// uni.navigateTo({
						// 	url: '/marketing_page/pages/member/index/index'
						// });
						app.globalData.CHECK_LOGIN(() => {
							// 会员列表
							noVipDetail().then(res => {
								console.log(res,'ffhy.List.....')
								if (res.code == 200) {
									let vipId = res.data[0].vipId
									uni.navigateTo({
										url: "/mine/pages/vip/noVip?id=" + vipId,
									})
								}
							})
						})
						break;
					case 9:
						let url = this.getPromoterDetailFun.spreadStatus == 1 ?
							'/marketing_page/pages/promotion/index/index' :
							'/marketing_page/pages/promotion/recruit_plan/recruit_plan';
						uni.navigateTo({
							url
						});
						break;
					case 10:
						uni.navigateTo({
							url: '/additional/firstTopUp/index?HD=' + marketingId
						})
						break;
				}
			},
			// 已读接口
			getReadPopUp: function(item) {
				var that = this;
				https_1
					.readPopUp(item)
					.then(function(res) {
						if (res.code == 0) {
							that.showCoupons2 = false
						}
					})['catch'](function(err) {
						console.log(err);
					});
			},
			//轮播图
			infos: function() {
				var tmp = this;
				let cityName = uni.getStorageSync('cityName').length > 0 ? uni.getStorageSync('cityName') : '全国';
				https_1
					.info({
						sellerNo: app.globalData.sellerNo,
						address: cityName
					})
					.then(function(res) {
						if (res.code == 0) {
							var imgArr_1 = [];
							var swiperItem = res.data.myAdvertising;
							if (swiperItem.length > 0) {
								swiperItem.forEach(function(element) {
									if (/^http/.test(element.image)) {
										imgArr_1.push({
											image: element.image,
											linkUrl: element.advertisingLink,
											linkType: element.connectionType,
											content: element.details,
											title: element.title,
											timeS: element.timeS,
											status: element.status,
											mobilePath: element.mobilePath,
											activityType: element.activityType,
											marketingId: element.marketingId,
										});
										tmp.setData({
											activ: true
										});
									} else {
										imgArr_1.push(tmp.info);
									}
								});
							}

							tmp.info = imgArr_1
							console.log(tmp.info, 'tmp.info')
						}
					});
			},

			getOldAndNewBenifit: function() {
				var that = this;
				var sellerId = app.globalData.sellerId
				https_1
					.getOldAndNewBenifit(sellerId)
					.then(function(res) {
						if (res.code == 0) {
							that.activityStatus = res.data.activityStatus
						}
					}).catch(function(err) {
						console.log(err);
					});
			},

			//刷新
			// onRefresh(){
			//   //在当前页面显示导航条加载动画
			//   wx.showNavigationBarLoading();
			//   //显示 loading 提示框。需主动调用 wx.hideLoading 才能关闭提示框
			//   wx.showLoading({
			//     title: '刷新中...',
			//   })
			//  this.getToken()
			// },
			//获取token
			getToken: function() {
				var that = this;
				var tel = uni.getStorageSync('tel');
				var openId = uni.getStorageSync('openid');
				const unionId = uni.getStorageSync('unionId');

				if (openId) {
					https_1
						.getToken({
							phoneNo: tel,
							unionId: unionId,
							openId: openId,
							sourceType: '3',
							sellerNo: app.globalData.sellerNo
						})
						.then(function(res) {
							uni.setStorageSync('token', res.data);
							that.getMemberInfo(); //隐藏loading 提示框

							uni.hideLoading(); //隐藏导航条加载动画

							uni.hideNavigationBarLoading(); //停止下拉刷新

							uni.stopPullDownRefresh();
						})['catch'](function() {
							//隐藏loading 提示框
							uni.hideLoading(); //隐藏导航条加载动画

							uni.hideNavigationBarLoading(); //停止下拉刷新

							uni.stopPullDownRefresh();
						});
				} else {
					//隐藏loading 提示框
					uni.hideLoading(); //隐藏导航条加载动画

					uni.hideNavigationBarLoading(); //停止下拉刷新

					uni.stopPullDownRefresh();
				}
			},

			onActivityClose() {
				this.showCoupons2 = false
			},
			// 获取用户（付费会员，成长会员）信息
			getMarketingAllMemberInfo() {
				console.log('这里获取个人信息1')
				getMarketingAllMemberInfo({
					plUserId: uni.getStorageSync('memberId')
				}).then((res) => {
					let marketingAllMemberInfo = res.data || {}
					console.log(marketingAllMemberInfo, '这是数据啦啦啦')
					// 处理进度条
					marketingAllMemberInfo.highestIntegral = marketingAllMemberInfo.highestIntegral + 1
					marketingAllMemberInfo.progress = (marketingAllMemberInfo.integral || 0) /
						marketingAllMemberInfo.highestIntegral * 100
					if (marketingAllMemberInfo.progress > 100) {
						marketingAllMemberInfo.progress = 100
					}
					// 处理还差多少积分
					marketingAllMemberInfo.differenceIntegral = (marketingAllMemberInfo.highestIntegral -
						marketingAllMemberInfo.integral) || 0
					if (marketingAllMemberInfo.differenceIntegral <= 0) {
						marketingAllMemberInfo.differenceIntegral = 0
					}
					this.setData({
						marketingAllMemberInfo
					})
					console.log(res, 12345688)
				}).catch(() => {
					// wx.hideLoading()
				})
			},
			//账户信息
			getAccountInfo: function(menberType) {
				// menberType:0个人2车队
				let tab = menberType == 0 ? 1 : 2
				var that = this;
				https_1
					.getAccountInfo({
						tab
					})
					.then(function(res) {
						if (res.code == 0) {
							that.accountInfo = res.data
						}
					})
			},
		}
	};
</script>
<style>

</style>
<style lang="less" scoped>
	@import "../../commin/commin.less";
	@import "./my.less";

	.uni-button-color {
		color: var(--textColor) !important;
	}

	/*
		此文件为开发者工具生成，生成时间: 2022/6/6下午4:40:40

		在 D:\work\Ts-mini\miniprogram\pages\my\my.wxss 中引入样式
		```
		@import "./my.skeleton.css";
		```

		更多详细信息可以参考文档：https://developers.weixin.qq.com/miniprogram/dev/devtools/skeleton.html
		*/
</style>
